package com.link2room.soundwave.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * @author sqj88
 * @date 2017/10/19 21:16
 */
@Entity
@Table(name = "yh_rmtype_avail_sync")
@DynamicInsert
public class YhRmtypeAvailSync extends BaseEntity{
    public enum YhRmtypeAvailSync_{
        businessDate,l2RRmtype
    }
    private Date businessDate;
    private String rmtype;
    private String l2RRmtype;
    private Integer saleNum;
    private Integer avail;
    private Integer todayDepartureQuantity;
    private Integer totalQuantity;
    private Integer oooQuantity;

    @Basic
    @Column(name = "business_date", nullable = false)
    public Date getBusinessDate() {
        return businessDate;
    }

    public void setBusinessDate(Date businessDate) {
        this.businessDate = businessDate;
    }

    @Basic
    @Column(name = "rmtype", nullable = false, length = 20)
    public String getRmtype() {
        return rmtype;
    }

    public void setRmtype(String rmtype) {
        this.rmtype = rmtype;
    }

    @Basic
    @Column(name = "l2r_rmtype", nullable = true, length = 32)
    public String getL2RRmtype() {
        return l2RRmtype;
    }

    public void setL2RRmtype(String l2RRmtype) {
        this.l2RRmtype = l2RRmtype;
    }

    @Basic
    @Column(name = "sale_num", nullable = true)
    public Integer getSaleNum() {
        return saleNum;
    }

    public void setSaleNum(Integer saleNum) {
        this.saleNum = saleNum;
    }

    @Basic
    @Column(name = "avail", nullable = true)
    public Integer getAvail() {
        return avail;
    }

    public void setAvail(Integer avail) {
        this.avail = avail;
    }

    @Basic
    @Column(name = "today_departure_quantity", nullable = true)
    public Integer getTodayDepartureQuantity() {
        return todayDepartureQuantity;
    }

    public void setTodayDepartureQuantity(Integer todayDepartureQuantity) {
        this.todayDepartureQuantity = todayDepartureQuantity;
    }

    @Basic
    @Column(name = "total_quantity", nullable = true)
    public Integer getTotalQuantity() {
        return totalQuantity;
    }

    public void setTotalQuantity(Integer totalQuantity) {
        this.totalQuantity = totalQuantity;
    }

    @Basic
    @Column(name = "ooo_quantity", nullable = true)
    public Integer getOooQuantity() {
        return oooQuantity;
    }

    public void setOooQuantity(Integer oooQuantity) {
        this.oooQuantity = oooQuantity;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        YhRmtypeAvailSync that = (YhRmtypeAvailSync) o;

        if (businessDate != null ? !businessDate.equals(that.businessDate) : that.businessDate != null) return false;
        if (rmtype != null ? !rmtype.equals(that.rmtype) : that.rmtype != null) return false;
        if (l2RRmtype != null ? !l2RRmtype.equals(that.l2RRmtype) : that.l2RRmtype != null) return false;
        if (saleNum != null ? !saleNum.equals(that.saleNum) : that.saleNum != null) return false;
        if (avail != null ? !avail.equals(that.avail) : that.avail != null) return false;
        return true;
    }

    @Override
    public int hashCode() {
        int result = businessDate != null ? businessDate.hashCode() : 0;
        result = 31 * result + (rmtype != null ? rmtype.hashCode() : 0);
        result = 31 * result + (l2RRmtype != null ? l2RRmtype.hashCode() : 0);
        result = 31 * result + (saleNum != null ? saleNum.hashCode() : 0);
        result = 31 * result + (avail != null ? avail.hashCode() : 0);
        return result;
    }
}
